<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {


//    return view('welcome');
});

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/


// 上传函数路由
Route::any("imageUpload",'Controller@imageUpload');

//  后台路由
Route::group(['prefix'=>'Admin','namespace'=>'Admin','middleware' => ['web']], function () {

    //
    Route::any('login','LoginController@index');
    Route::get('code','LoginController@code');
    Route::group(['middleware'=>['web','admin.login']],function (){

        // 首页以及个人信息
        Route::get('','IndexController@index');
        Route::get('index','IndexController@index');
        Route::get('info','IndexController@info');

        Route::get('quit','LoginController@quit');
        Route::any('passUpdate','LoginController@passUpdate');
        Route::get('password','LoginController@password');

        // 友情链接
        Route::resource('link','LinkController');

        Route::post('linkOrder','LinkController@linkOrder');

//        分类

        Route::resource('category','CategoryController');
        // 网站配置
        Route::resource('config','ConfigController');
        Route::post('confOrder','ConfigController@confOrder');
        Route::post('configWrite','ConfigController@configWrite');

        // 标签管理模块
        Route::resource('tag','TagController');
        Route::post('tagOrder','TagController@tagOrder');

        // 幻灯片管理模块
        Route::resource("slider","SliderController");

        // 自定义导航模块
        Route::resource("navigator","NavigatorController");
        Route::post('navOrder','NavigatorController@navOrder');

        // 公告
        Route::resource('notice','NoticeController');

        // 新闻
        Route::resource("news","NewsController");

        Route::resource("other","OtherController");
    }
    );
});


// 前台路由

Route::group(['prefix'=>'','namespace'=>'Home','middleware' => ['web']], function () {

    Route::get('','IndexController@index');
    Route::get('index','IndexController@index');
    Route::get('about','IndexController@about');

    Route::get('news','NewsController@index');
    Route::get('news_item','NewsController@newsShow');

    Route::get('notice','NoticeController@index');
    Route::get('notice_item','NoticeController@noticeShow');

    Route::get('talent','IndexController@talent');

    Route::get('connect','IndexController@connect');

    Route::get('help','IndexController@help');

    Route::get('other','OtherController@index');

});